<template>
  <view class="right-column">
    <view class="right-row">
      <DailyCheckCard />
    </view>
    <view class="right-row" title="右侧第二行">
      <view v-for="(item, index) in items" :key="index">
        <list-ask
          :avatar="item.avatar"
          :name="item.name"
          :id="item.id"
		  :user_id="item.user_id"
          :content="item.content"
          @handleReply="handleReplyData"
        />
      </view>
    </view>
  </view>
</template>

<script>
import DailyCheckCard from '@/components/wrap/Check.vue';
import ListAsk from '@/components/wrap/ListAsk.vue';

export default {
  components: {
    DailyCheckCard,
    ListAsk
  },
  data() {
    return {
      items: [
        {
          avatar: '/static/images/profile.png',
          name: 'user1222',
          content: '这是提问者1的正文内容。这是提问者1的正文内容2。',
          id: 1
        }
      ]
    };
  },
  methods: {
    handleReplyData(data) {
      console.log('接收到的数据:', data);
      const queryParams = {
        id: data.id,
		user_id: data.user_id,
        name: data.name,
        avatar: data.avatar,
        content: data.content
      };
      this.$router.push({ path: '/pages/answer/answer', query: queryParams });
    },
    navigateToList(id) {
		console.clear();
       console.log("跳转到问题详情"+id);
    }
  }
};
</script>


<style>
	.right-column {
		width: 100%;
		display: flex;
		flex-direction: column;
		height: 100%;
	}

	.right-row {
		flex: 1;
		/* background-color: #e0e0e0; */
		display: flex;
		justify-content: center;
		align-items: center;
		height: 100%;
		border-bottom: 0px solid #ccc;
		margin-left: 10px;
		margin-bottom: 0px;
	}

	.right-row:last-child {
		margin-top: 10px;
		border-bottom: none;
		height: 300px;
		display: block;
		/* background: #000; */
	}
</style>
 